<?php

/*
 * This function will check if the document is rejected.
 * 
 * Created by: Peter Agno Jr.
 * Date created: November 1, 2011
 * 
 * In parameters : documentId
 * Out parameters : true or false
 */

    function isRejected ($documentId) {
        // Check in Logs
        $query =
            "
                SELECT *
                FROM Log
                WHERE documentId = '$documentId' AND activity = 'Rejected'
            ";
        
        $result = mysql_query($query) or die ('Error in query: $query. ' . mysql_error());
        
        if ( mysql_num_rows($result) > 0 ) {
            mysql_free_result($result);
            return true;
        }
        else {
            mysql_free_result($result);
            return false;
        }
    }
?>
